<?php

use App\Http\Controllers\ActionLogController;
use App\Http\Controllers\AdController;
use App\Http\Controllers\AdSortController;
use App\Http\Controllers\ArticleController;
use App\Http\Controllers\CityController;
use App\Http\Controllers\ConfigDataController;
use App\Http\Controllers\ConfigController;
use App\Http\Controllers\ConfigWebController;
use App\Http\Controllers\DeptController;
use App\Http\Controllers\DictDataController;
use App\Http\Controllers\DictController;
use App\Http\Controllers\GenerateController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\ItemCateController;
use App\Http\Controllers\ItemController;
use App\Http\Controllers\LayoutController;
use App\Http\Controllers\LayoutDescController;
use App\Http\Controllers\LevelController;
use App\Http\Controllers\LinkController;
use App\Http\Controllers\LoginLogController;
use App\Http\Controllers\MemberController;
use App\Http\Controllers\MemberLevelController;
use App\Http\Controllers\MenuController;
use App\Http\Controllers\NoticeController;
use App\Http\Controllers\OrganizationController;
use App\Http\Controllers\PositionController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\TestController;
use App\Http\Controllers\UploadController;
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\Register\RegisterController;
use App\Http\Controllers\Assess\CommentGuideLinkController;
use App\Http\Controllers\Assess\OrderAndCustomersOrderController;
use App\Http\Controllers\Assess\GiftSetController;
use App\Http\Controllers\Assess\UploadNoLoginController;
use App\Http\Controllers\Assess\BuyerController;
use App\Http\Controllers\Assess\ActivateController;
use App\Http\Controllers\Assess\VisitorsRecordController;
use App\Http\Controllers\Assess\ActivateExceptionController;
use App\Http\Controllers\Assess\EmailTemplateController;
use App\Http\Controllers\Assess\TagManageController;
use App\Http\Controllers\Assess\EvaluationMonitoringController;
use App\Http\Controllers\Assess\SendLogController;
use App\Http\Controllers\Account\UserAccountController;
use App\Http\Controllers\Account\UserEmailController;
use App\Http\Controllers\Assess\DataBoardController;
use App\Http\Controllers\Assess\OperateController;
use App\Http\Controllers\Assess\AutoEmailController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//测评激活
Route::post('/v1/register', [RegisterController::class, 'register']);
//确认礼品 产品提交
Route::post('/v1/confirmProduct', [RegisterController::class, 'confirmProduct']);
//获取买家端设置信息
Route::get('/v1/getBuyerConfig', [RegisterController::class, 'getBuyerConfig']);
//检查邮箱格式是否正确
Route::get('/v1/checkEmail', [RegisterController::class, 'checkEmail']);
//访客记录
Route::post('/v1/setVisitorsRecord', [RegisterController::class, 'setVisitorsRecord']);
//发送邮件后标记已读
Route::get('/v1/emailReady', [RegisterController::class, 'emailReady']);

//选择非产品 保存评价信息
Route::post('/v1/confirmComment', [RegisterController::class, 'confirmComment']);
Route::prefix('/v1/uploadNoLogin')->group(function () {
    Route::post('uploadImage', [UploadNoLoginController::class, 'uploadImage']);
    Route::post('uploadFile', [UploadNoLoginController::class, 'uploadFile']);
});

// 系统登录
Route::get('/v1/captcha', [LoginController::class, 'captcha'])->name('captcha');
Route::post('/v1/login', [LoginController::class, 'login']);
Route::get('/v1/logout', [LoginController::class, 'logout']);

Route::group(['middleware' => ['user.login']], function () {

    //数据看板
    Route::prefix('v1/dataBoard')->group(function () {
        Route::get('getTabData', [DataBoardController::class, 'getTabData']);
    });

    // 留评引导链接
    Route::prefix('v1/commentGuideLink')->group(function () {
        Route::get('index', [CommentGuideLinkController::class, 'index']);
        Route::get('info', [CommentGuideLinkController::class, 'info']);
        Route::get('getCommentConfig', [CommentGuideLinkController::class, 'getCommentConfig']);
        Route::post('edit', [CommentGuideLinkController::class, 'edit']);
        Route::post('delete', [CommentGuideLinkController::class, 'delete']);
        Route::post('status', [CommentGuideLinkController::class, 'status']);
    });
    //礼品设置
    Route::prefix('v1/giftSet')->group(function () {
        Route::get('index', [GiftSetController::class, 'index']);
        Route::get('getGiftConfig', [GiftSetController::class, 'getGiftConfig']);
        Route::get('getOrderSku', [GiftSetController::class, 'getOrderSku']);
        Route::get('info', [GiftSetController::class, 'info']);
        Route::post('edit', [GiftSetController::class, 'edit']);
        Route::post('delete', [GiftSetController::class, 'delete']);
        Route::post('status', [GiftSetController::class, 'status']);
    });
    //自动信配置
    Route::prefix('v1/autoEmail')->group(function () {
        Route::get('index', [AutoEmailController::class, 'index']);
        Route::get('getAutoEmailConfig', [AutoEmailController::class, 'getAutoEmailConfig']);
        Route::get('info', [AutoEmailController::class, 'info']);
        Route::post('edit', [AutoEmailController::class, 'edit']);
        Route::post('delete', [AutoEmailController::class, 'delete']);
        Route::post('status', [AutoEmailController::class, 'status']);
    });
    //买家端设置
    Route::prefix('v1/buyer')->group(function () {
        Route::get('index', [BuyerController::class, 'index']);
        Route::get('getBuyerConfig', [BuyerController::class, 'getBuyerConfig']);
        Route::get('getBuyerData', [BuyerController::class, 'getBuyerData']);
        Route::get('info', [BuyerController::class, 'info']);
        Route::post('edit', [BuyerController::class, 'edit']);
        Route::post('delete', [BuyerController::class, 'delete']);
        Route::post('status', [BuyerController::class, 'status']);
    });

    //运营端设置
    Route::prefix('v1/operate')->group(function () {
        Route::get('index', [OperateController::class, 'index']);
        Route::get('getOperateConfig', [OperateController::class, 'getOperateConfig']);
        Route::get('getBuyerData', [OperateController::class, 'getBuyerData']);
        Route::get('info', [OperateController::class, 'info']);
        Route::post('edit', [OperateController::class, 'edit']);
        Route::post('delete', [OperateController::class, 'delete']);
        Route::post('status', [OperateController::class, 'status']);
    });

    //用户与账号管理
    Route::prefix('v1/userAccount')->group(function () {
        Route::get('index', [UserAccountController::class, 'index']);
        Route::get('getUserAccountConfig', [UserAccountController::class, 'getUserAccountConfig']);
        Route::post('edit', [UserAccountController::class, 'edit']);
        Route::post('delete', [UserAccountController::class, 'delete']);
        Route::post('status', [UserAccountController::class, 'status']);
    });

    //用户与邮箱管理
    Route::prefix('v1/userEmail')->group(function () {
        Route::get('index', [UserEmailController::class, 'index']);
        Route::get('getUserEmailConfig', [UserEmailController::class, 'getUserEmailConfig']);
        Route::post('edit', [UserEmailController::class, 'edit']);
        Route::post('delete', [UserEmailController::class, 'delete']);
        Route::post('status', [UserEmailController::class, 'status']);
    });

    //订单管理
    Route::prefix('v1/OrderAndCustomersOrder')->group(function () {
        Route::get('index', [OrderAndCustomersOrderController::class, 'index']);
        Route::get('info', [OrderAndCustomersOrderController::class, 'info']);
        Route::get('orderConfig', [OrderAndCustomersOrderController::class, 'orderConfig']);
        Route::post('edit', [OrderAndCustomersOrderController::class, 'edit']);
        Route::post('delete', [OrderAndCustomersOrderController::class, 'delete']);
        Route::post('status', [OrderAndCustomersOrderController::class, 'status']);
        Route::post('importExcel', [OrderAndCustomersOrderController::class, 'importExcel']);
        Route::post('importOrder', [OrderAndCustomersOrderController::class, 'importOrder']);
    });
    //激活买家管理
    Route::prefix('v1/activate')->group(function () {
        Route::get('index', [ActivateController::class, 'index']);
        Route::get('info', [ActivateController::class, 'info']);
        Route::get('activateConfig', [ActivateController::class, 'activateConfig']);//获取激活买家管理配置
        Route::get('getEdmTemplate', [ActivateController::class, 'getEdmTemplate']); //发送邮件
        Route::post('getMatchDetail', [ActivateController::class, 'getMatchDetail']); //获取系统评价信息
        Route::post('edit', [ActivateController::class, 'edit']);
        Route::post('delete', [ActivateController::class, 'delete']);
        Route::post('status', [ActivateController::class, 'status']);//修改状态
        Route::post('handEndProgress', [ActivateController::class, 'handEndProgress']);//结束流程
        Route::post('matchCommentInfo', [ActivateController::class, 'matchCommentInfo']);//匹配当前页留评信息
        Route::post('submitRemarks', [ActivateController::class, 'submitRemarks']);//提交备注
        Route::post('importExcel', [ActivateController::class, 'importExcel']);//导入excel
        Route::post('sendEmail', [ActivateController::class, 'sendEmail']); //发送邮件
        Route::post('addTag', [ActivateController::class, 'addTag']); //添加标签
        Route::post('addTagBatch', [ActivateController::class, 'addTagBatch']); //批量添加标签
        Route::post('confirmMate', [ActivateController::class, 'confirmMate']); //系统评论信息 确认匹配
        Route::post('matchActivateSuccess', [ActivateController::class, 'matchActivateSuccess']); //激活失败 匹配激活成功

    });
    //激活买家异常管理
    Route::prefix('v1/activateException')->group(function () {
        Route::get('index', [ActivateExceptionController::class, 'index']);
        Route::post('processedStatus', [ActivateExceptionController::class, 'processedStatus']);
        Route::post('processedStatusBatch', [ActivateExceptionController::class, 'processedStatusBatch']);
    });

    //访客日志
    Route::prefix('v1/visitors')->group(function () {
        Route::get('index', [VisitorsRecordController::class, 'index']);
        Route::get('info', [VisitorsRecordController::class, 'info']);
        Route::get('getVisitorConfig', [VisitorsRecordController::class, 'getVisitorConfig']);
        Route::post('edit', [VisitorsRecordController::class, 'edit']);
        Route::post('delete', [VisitorsRecordController::class, 'delete']);
        Route::post('status', [VisitorsRecordController::class, 'status']);
    });

    //邮件发送记录管理
    Route::prefix('v1/sendLog')->group(function () {
        Route::get('index', [SendLogController::class, 'index']);
        Route::get('getSendLogConfig', [SendLogController::class, 'getSendLogConfig']);
    });

    //邮件模板管理
    Route::prefix('v1/emailTemplate')->group(function () {
        Route::get('index', [EmailTemplateController::class, 'index']);
        Route::get('getEmailTemplateConfig', [EmailTemplateController::class, 'getEmailTemplateConfig']);
        Route::post('edit', [EmailTemplateController::class, 'edit']);
        Route::post('delete', [EmailTemplateController::class, 'delete']);
    });

    //评价监控
    Route::prefix('v1/EvaluationMonitoring')->group(function () {
        Route::get('index', [EvaluationMonitoringController::class, 'index']);
        Route::get('getEvaluationMonitoringConfig', [EvaluationMonitoringController::class, 'getEvaluationMonitoringConfig']);
        Route::get('detail', [EvaluationMonitoringController::class, 'detail']);
        Route::get('getTagManageConfig', [EvaluationMonitoringController::class, 'getTagManageConfig']);
        Route::get('getTagList', [EvaluationMonitoringController::class, 'getTagList']);
        Route::post('edit', [EvaluationMonitoringController::class, 'edit']);
        Route::post('importAsinComment', [EvaluationMonitoringController::class, 'importAsinComment']);
        Route::post('status', [EvaluationMonitoringController::class, 'status']);
        Route::post('delete', [EvaluationMonitoringController::class, 'delete']);
    });

    //标签管理
    Route::prefix('v1/tagManage')->group(function () {
        Route::get('index', [TagManageController::class, 'index']);
        Route::get('getTagManageConfig', [TagManageController::class, 'getTagManageConfig']);
        Route::get('getTagList', [TagManageController::class, 'getTagList']);
        Route::post('edit', [TagManageController::class, 'edit']);
        Route::post('status', [TagManageController::class, 'status']);
        Route::post('delete', [TagManageController::class, 'delete']);
    });

    // 文件上传
    Route::prefix('v1/upload')->group(function () {
        Route::post('uploadImage', [UploadController::class, 'uploadImage']);
        Route::post('uploadFile', [UploadController::class, 'uploadFile']);
    });

    // 系统主页
    Route::prefix('v1/index')->group(function () {
        Route::get('getMenuList', [IndexController::class, 'getMenuList']);
        Route::get('getUserInfo', [IndexController::class, 'getUserInfo']);
        Route::post('updateUserInfo', [IndexController::class, 'updateUserInfo']);
        Route::post('updatePwd', [IndexController::class, 'updatePwd']);
    });

    // 用户管理
    Route::prefix('v1/user')->group(function () {
        Route::get('index', [UserController::class, 'index']);
        Route::get('info', [UserController::class, 'info']);
        Route::post('edit', [UserController::class, 'edit']);
        Route::post('delete', [UserController::class, 'delete']);
        Route::post('status', [UserController::class, 'status']);
        Route::post('resetPwd', [UserController::class, 'resetPwd']);
    });

    // 职级管理
    Route::prefix('v1/level')->group(function () {
        Route::get('index', [LevelController::class, 'index']);
        Route::get('info', [LevelController::class, 'info']);
        Route::post('edit', [LevelController::class, 'edit']);
        Route::post('delete', [LevelController::class, 'delete']);
        Route::post('status', [LevelController::class, 'status']);
        Route::get('getLevelList', [LevelController::class, 'getLevelList']);
        Route::post('importExcel', [LevelController::class, 'importExcel']);
        Route::get('exportExcel', [LevelController::class, 'exportExcel']);
    });

    // 岗位管理
    Route::prefix('v1/position')->group(function () {
        Route::get('index', [PositionController::class, 'index']);
        Route::get('info', [PositionController::class, 'info']);
        Route::post('edit', [PositionController::class, 'edit']);
        Route::post('delete', [PositionController::class, 'delete']);
        Route::post('status', [PositionController::class, 'status']);
        Route::get('getPositionList', [PositionController::class, 'getPositionList']);
    });

    // 角色管理
    Route::prefix('v1/role')->group(function () {
        Route::get('index', [RoleController::class, 'index']);
        Route::get('info', [RoleController::class, 'info']);
        Route::post('edit', [RoleController::class, 'edit']);
        Route::post('delete', [RoleController::class, 'delete']);
        Route::post('status', [RoleController::class, 'status']);
        Route::get('getRoleList', [RoleController::class, 'getRoleList']);
        Route::get('getPermissionList', [RoleController::class, 'getPermissionList']);
        Route::post('savePermission', [RoleController::class, 'savePermission']);
    });

    // 菜单管理
    Route::prefix('v1/menu')->group(function () {
        Route::get('index', [MenuController::class, 'index']);
        Route::get('info', [MenuController::class, 'info']);
        Route::post('edit', [MenuController::class, 'edit']);
        Route::post('delete', [MenuController::class, 'delete']);
        Route::get('getMenuAll', [MenuController::class, 'getMenuAll']);
    });

    // 部门管理
    Route::prefix('v1/dept')->group(function () {
        Route::get('index', [DeptController::class, 'index']);
        Route::get('info', [DeptController::class, 'info']);
        Route::post('edit', [DeptController::class, 'edit']);
        Route::post('delete', [DeptController::class, 'delete']);
        Route::get('getDeptList', [DeptController::class, 'getDeptList']);
    });

    // 城市管理
    Route::prefix('v1/city')->group(function () {
        Route::get('index', [CityController::class, 'index']);
        Route::get('info', [CityController::class, 'info']);
        Route::post('edit', [CityController::class, 'edit']);
        Route::post('delete', [CityController::class, 'delete']);
    });

    // 字典管理
    Route::prefix('v1/dict')->group(function () {
        Route::get('index', [DictController::class, 'index']);
        Route::get('info', [DictController::class, 'info']);
        Route::post('edit', [DictController::class, 'edit']);
        Route::post('delete', [DictController::class, 'delete']);
    });

    // 字典数据管理
    Route::prefix('v1/dictdata')->group(function () {
        Route::get('index', [DictDataController::class, 'index']);
        Route::get('info', [DictDataController::class, 'info']);
        Route::post('edit', [DictDataController::class, 'edit']);
        Route::post('delete', [DictDataController::class, 'delete']);
        Route::post('status', [DictDataController::class, 'status']);
        Route::get('getDictByCode', [DictDataController::class, 'getDictByCode']);
    });

    // 配置管理
    Route::prefix('v1/config')->group(function () {
        Route::get('index', [ConfigController::class, 'index']);
        Route::get('info', [ConfigController::class, 'info']);
        Route::post('edit', [ConfigController::class, 'edit']);
        Route::post('delete', [ConfigController::class, 'delete']);
    });

    // 配置项管理
    Route::prefix('v1/configdata')->group(function () {
        Route::get('index', [ConfigDataController::class, 'index']);
        Route::get('info', [ConfigDataController::class, 'info']);
        Route::post('edit', [ConfigDataController::class, 'edit']);
        Route::post('delete', [ConfigDataController::class, 'delete']);
        Route::post('status', [ConfigDataController::class, 'status']);
    });

    // 通知公告
    Route::prefix('v1/notice')->group(function () {
        Route::get('index', [NoticeController::class, 'index']);
        Route::get('info', [NoticeController::class, 'info']);
        Route::post('edit', [NoticeController::class, 'edit']);
        Route::post('delete', [NoticeController::class, 'delete']);
        Route::post('status', [NoticeController::class, 'status']);
        Route::post('setIsTop', [NoticeController::class, 'setIsTop']);
    });

    // 站点管理
    Route::prefix('v1/item')->group(function () {
        Route::get('index', [ItemController::class, 'index']);
        Route::get('info', [ItemController::class, 'info']);
        Route::post('edit', [ItemController::class, 'edit']);
        Route::post('delete', [ItemController::class, 'delete']);
        Route::post('status', [ItemController::class, 'status']);
        Route::get('getItemList', [ItemController::class, 'getItemList']);
    });

    // 栏目管理
    Route::prefix('v1/itemcate')->group(function () {
        Route::get('index', [ItemCateController::class, 'index']);
        Route::get('info', [ItemCateController::class, 'info']);
        Route::post('edit', [ItemCateController::class, 'edit']);
        Route::post('delete', [ItemCateController::class, 'delete']);
        Route::post('status', [ItemCateController::class, 'status']);
        Route::get('getCateList', [ItemCateController::class, 'getCateList']);
    });

    // 广告位管理
    Route::prefix('v1/adsort')->group(function () {
        Route::get('index', [AdSortController::class, 'index']);
        Route::get('info', [AdSortController::class, 'info']);
        Route::post('edit', [AdSortController::class, 'edit']);
        Route::post('delete', [AdSortController::class, 'delete']);
        Route::get('getAdSortList', [AdSortController::class, 'getAdSortList']);
    });

    // 广告管理
    Route::prefix('v1/ad')->group(function () {
        Route::get('index', [AdController::class, 'index']);
        Route::get('info', [AdController::class, 'info']);
        Route::post('edit', [AdController::class, 'edit']);
        Route::post('delete', [AdController::class, 'delete']);
        Route::post('status', [AdController::class, 'status']);
    });

    // 布局描述
    Route::prefix('v1/layoutdesc')->group(function () {
        Route::get('index', [LayoutDescController::class, 'index']);
        Route::get('info', [LayoutDescController::class, 'info']);
        Route::post('edit', [LayoutDescController::class, 'edit']);
        Route::post('delete', [LayoutDescController::class, 'delete']);
        Route::get('getLayoutDescList', [LayoutDescController::class, 'getLayoutDescList']);
    });

    // 布局管理
    Route::prefix('v1/layout')->group(function () {
        Route::get('index', [LayoutController::class, 'index']);
        Route::get('info', [LayoutController::class, 'info']);
        Route::post('edit', [LayoutController::class, 'edit']);
        Route::post('delete', [LayoutController::class, 'delete']);
    });

    // 友链管理
    Route::prefix('v1/link')->group(function () {
        Route::get('index', [LinkController::class, 'index']);
        Route::get('info', [LinkController::class, 'info']);
        Route::post('edit', [LinkController::class, 'edit']);
        Route::post('delete', [LinkController::class, 'delete']);
        Route::post('status', [LinkController::class, 'status']);
    });

    // 文章管理
    Route::prefix('v1/article')->group(function () {
        Route::get('index', [ArticleController::class, 'index']);
        Route::get('info', [ArticleController::class, 'info']);
        Route::post('edit', [ArticleController::class, 'edit']);
        Route::post('delete', [ArticleController::class, 'delete']);
        Route::post('status', [ArticleController::class, 'status']);
    });

    // 会员等级
    Route::prefix('v1/memberlevel')->group(function () {
        Route::get('index', [MemberLevelController::class, 'index']);
        Route::get('info', [MemberLevelController::class, 'info']);
        Route::post('edit', [MemberLevelController::class, 'edit']);
        Route::post('delete', [MemberLevelController::class, 'delete']);
        Route::get('getMemberLevelList', [MemberLevelController::class, 'getMemberLevelList']);
    });

    // 会员管理
    Route::prefix('v1/member')->group(function () {
        Route::get('index', [MemberController::class, 'index']);
        Route::get('info', [MemberController::class, 'info']);
        Route::post('edit', [MemberController::class, 'edit']);
        Route::post('delete', [MemberController::class, 'delete']);
        Route::post('status', [MemberController::class, 'status']);
    });

    // 登录日志
    Route::prefix('v1/loginlog')->group(function () {
        Route::get('index', [LoginLogController::class, 'index']);
        Route::post('delete', [LoginLogController::class, 'delete']);
    });

    // 操作日志
    Route::prefix('v1/actionlog')->group(function () {
        Route::get('index', [ActionLogController::class, 'index']);
        Route::post('delete', [ActionLogController::class, 'delete']);
    });

    // 代码生成器
    Route::prefix('generate')->group(function () {
        Route::get('index', [GenerateController::class, 'index']);
        Route::post('generate', [GenerateController::class, 'generate']);
        Route::post('batchGenerate', [GenerateController::class, 'batchGenerate']);
    });

    // 网站配置
    Route::prefix('v1/configweb')->group(function () {
        Route::get('index', [ConfigWebController::class, 'index']);
        Route::post('edit', [ConfigWebController::class, 'edit']);
    });

    // 组织机构
    Route::prefix('v1/organization')->group(function () {
        Route::get('index', [OrganizationController::class, 'index']);
        Route::get('info', [OrganizationController::class, 'info']);
        Route::post('edit', [OrganizationController::class, 'edit']);
        Route::post('delete', [OrganizationController::class, 'delete']);
    });

    // 脚本数据
    Route::prefix('v1/test')->group(function () {
        Route::get('index', [TestController::class, 'index']);
    });

});
